package alan.springboot2x.swagger.knife4j.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {

    final static String SUCCESS = "200";
    final static String SUCCESS_MSG = "200";
    final static String ERROR = "9999";

    String code = "200";
    String msg = "ok";
    Object data;

    public static Result setFail(String msg){
        return new Result(ERROR,msg,null);
    }

    public static Result setSuccess(Object data){
        return new Result(SUCCESS,SUCCESS_MSG,data);
    }

}

